﻿using System.Collections;
using System.Collections.Generic;
using Framework.Core;
using UnityEngine;
using UnityEngine.UI;

namespace App.UI
{
    /// <summary>
    /// 提示框，接受一个字符串参数显示出来。
    /// </summary>
    public class DialogUI : UIBase
    {
        /// <summary>
        /// 当UI被显示时执行。
        /// </summary>
        /// <param name="args">显示的提示信息。</param>
        public override void OnDisplay(object args)
        {
            base.OnDisplay(args);
            Get<Text>("Title").text = args as string;
        }

        /// <summary>
        /// 当按下确定键执行。
        /// </summary>
        public void OnOKClick()
        {
            UIManager.Instance.Close(this);
        }
    }
}